<extend file='../master'/>
<block name="content">
    <ul class="nav nav-tabs" role="tablist">
        <li><a href="{{u('typeAttr.index')}}">类型属性管理</a></li>
        <li class="active"><a href="">类型属性编辑</a></li>
    </ul>
    <form class="form-horizontal" id="form" action="" method="post"onsubmit="return edit()">
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">类型属性管理管理</h3>
            </div>
            <div class="panel-body">
                <div class="form-group">
                    <label for="" class="col-sm-2 control-label">类型属性名称</label>
                    <div class="col-sm-9">
                        <input type="text" name="taname"  class="form-control" value="{{$oldData['taname']}}" ">
                    </div>
                </div>

            </div>
            <div class="panel-body">
                <div class="form-group">
                    <label for="" class="col-sm-2 control-label">类型属性值</label>
                    <div class="col-sm-9">
                        <input type="text" name="tavalue"  class="form-control" value="{{$oldData['tavalue']}}">
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">类型</label>
                <div class="col-sm-10">
                    <label class="radio-inline">
                        <input type="radio" value="1" name="class" <if value="$oldData['class']==1">checked</if> > <i></i> 规格
                    </label>
                    <label class="radio-inline">
                        <input type="radio" value="2" name="class"  <if value="$oldData['class']==2">checked</if>  ><i></i> 属性
                    </label>
                </div>
            </div>
        </div>
        <input type="hidden" name="taid" value="{{q('get.taid')}}">
        <input type="hidden" name="tid" value="{{q('get.tid')}}">
        <button class="btn btn-primary" type="submit">确定</button>
    </form>
</block>
<script>
    function edit(){
        var data = $('#form').serialize();
        $.post("{{u('typeAttr.edit')}}",data,function(res){
            if(res.valid){
                util.message(res.message,'{{u("index",["tid"=>Q("tid")])}}','success');
            }else{
                util.message(res.message,'','error');
            }
        },'json');
        return false;
    }
</script>
